package com.itheima.网络编程.tcp编程.tcp编程.tcp网络编程;

import java.io.*;
import java.net.ServerSocket;
import java.net.Socket;

public class 文件服务端 {
    public static void main(String[] args) throws IOException {
        ServerSocket ss=new ServerSocket(10022);
        Socket sk=ss.accept();
        BufferedReader br=new BufferedReader(new InputStreamReader(sk.getInputStream()));
        BufferedWriter bw=new BufferedWriter(new FileWriter("day16 网络编程\\aaa.txt"));
        String line;
        while ((line=br.readLine())!=null){
            bw.write(line);
            bw.newLine();
        }
        sk.shutdownOutput();
        bw.close();
        br.close();
        ss.close();
        sk.close();


    }
}
